package demo2;

import java.util.ArrayList;

public class Test {
    public static void main(String[] args) {
        String str1 = "welcome to bit";
        String str2 = "come";
        ArrayList<Character> arrayList = new ArrayList<>();
        ArrayList<Character> arrayList1 = new ArrayList<>();
        for (int i = 0; i < str1.length(); i++) {
            arrayList.add(str1.charAt(i));
        }
        for (int i = 0; i < str2.length(); i++) {
            arrayList1.add(str2.charAt(i));
        }

        for (int i = 0; i < str1.length(); i++) {
            char ch = str1.charAt(i);
            if (arrayList1.contains(ch)) {
                arrayList.remove((Character) ch);
            }
        }
        System.out.println(arrayList.toString());

    }
}
